<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script>
    // 1-100和为
    var num = 0;
    for(var i=1; i<=100;i++){
        num = num + i;
    }
    var average = num / 100;
    alert('平均值：'+average);
    // 1-100偶数和与奇数和
    var even = 0;
    var odd = 0;
    for (var i=1 ;i<=100;i++){
        if(i % 2==0){
            even = even + i;
        }else{
            odd = odd + i;
        }
    }
    alert('偶数和为：'+even+'.....'+'奇数和为：'+odd);
    // 1-100之间能被3整除的数字和
    var sum = 0;
    for(var i=1; i<=100;i++){
        if(i%3==0){
            sum=sum + i ;
        }
    }
    alert('总数为：'+sum);
</script>
<body>
    
</body>
</html>